package com.xl.web.controller.zoom;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import jodd.util.StringUtil;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.xl.base.annotation.Auth;
import com.xl.base.web.BaseController;
import com.xl.core.util.HtmlUtil;
import com.xl.web.entity.zoom.Company;
import com.xl.web.entity.zoom.SysUser;
import com.xl.web.service.zoom.CompanyService;

@Controller
@Scope("prototype")
@RequestMapping(value="/company",method=RequestMethod.GET)
public class CompanyController extends BaseController {
	@Autowired(required = false)
	private CompanyService<Company> companyService;
	@ResponseBody
	@RequestMapping("/query")
	@Auth(verifyLogin = false)
	public void queryCompanyList(Company company) throws Exception {
		Map<String, Object> result = new HashMap<String, Object>();
		List<Company> companyList = companyService.queryCompanyList(company);
		result.put(this.SUCCESS, true);
		result.put(this.MSG, "查询成功!");
		result.put("count", companyList != null ? companyList.size() : 0);
		result.put("data", companyList);
		HtmlUtil.writerJson(response, result);
	}
}
